﻿<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="../../common/taglibs.jsp" %>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/favicon.ico" >
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<title>添加用户</title>
</head>
<body>
<form action="" method="post" class="form form-horizontal" id="form-member-add">
    <c:if test="${method eq 'add'}">
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户管理 <span class="c-gray en">&gt;
</span>
    添加用户
    <c:if test="${user.type =='3'}">
    <span class="">切换当前域名:
    <select  id="domain" name="domain" >
            <c:forEach items="${domainList}" var="domain">
                <option value="${domain.domain_name}" <c:if test="${domain1 eq domain.domain_name}">selected</c:if>>${domain.domain_name}</option>
            </c:forEach>
    </select>
    </span>
    </c:if>
    <c:if test="${user.type == '2'}">
        <input type="hidden" name="domain" id="domain" value="${user.domain}">
    </c:if>
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    </c:if>



<article class="page-container">
    <input type="hidden" class="input-text" value="${users.id}" placeholder="" id="id" name="id">
        <%--<div class="row cl">--%>
            <%--<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>域：</label>--%>
            <%--<div class="formControls col-xs-8 col-sm-9"> <span class="select-box" style="width:150px;">--%>
            <%--<select class="select" name="domain" size="1">--%>
            <%--<option value="">------</option>--%>
             <%--<c:forEach items="${domainList}" var="domain" >--%>
                <%--<option value="${domain.domain_name}" <c:if test="${domain.domain_name eq user.domain}">selected</c:if> >${domain.domain_name}</option>--%>
             <%--</c:forEach>--%>
            <%--</select>--%>
            <%--</span> </div>--%>
        <%--</div>--%>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>邮箱名：</label>
            <div class="formControls col-xs-4 col-sm-3">
                <input type="text" class="input-text"  value="${users.user_name}" placeholder="" name="user_name" id="user_name">
            </div>
            <div class="formControls col-xs-4 col-sm-3">
                @${not empty domain1?domain1:user.domain}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>姓名：</label>
            <div class="formControls col-xs-4 col-sm-3">
                <input type="text" class="input-text" value="${users.name}" placeholder="" id="name" name="name">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>性别：</label>
            <div class="formControls col-xs-5 col-sm-4 skin-minimal">
                <div class="radio-box">
                    <input name="sex" type="radio" id="sex-1"  value="男" <c:if test="${users.sex eq '男'}">checked</c:if>>
                    <label for="sex-1">男</label>
                </div>
                <div class="radio-box">
                    <input type="radio" id="sex-2" name="sex" value="女" <c:if test="${users.sex eq '女'}">checked</c:if>>
                    <label for="sex-2">女</label>
                </div>
                <div class="radio-box">
                    <input type="radio" id="sex-3" name="sex" value="" <c:if test="${users.sex ne '男' or  user.sex ne '女'}">checked</c:if>>
                    <label for="sex-3">保密</label>
                </div>
            </div>
        </div>
        <c:if test="${method eq 'add'}">
		    <div class="row cl">
		        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>初始密码：</label>
		        <div class="formControls col-xs-4 col-sm-3">
		            <input type="password" class="input-text" autocomplete="off" value="" placeholder="密码" id="password" name="password">
		        </div>
		    </div>
		    <div class="row cl">
		        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>确认密码：</label>
		        <div class="formControls col-xs-4 col-sm-3">
		            <input type="password" class="input-text" autocomplete="off"  placeholder="确认新密码" id="password2" name="password2">
		        </div>
		    </div>
		    </c:if>
    <c:if test="${method ne 'add'}">
        <input type="hidden" name="domain" value="${not empty domain1?domain1:user.domain}">
    </c:if>
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red"></span>公积金帐号：</label>
        <div class="formControls col-xs-4 col-sm-3">
            <input type="text" class="input-text" value="${users.gjjAccount}" placeholder="" id="gjjAccount" name="gjjAccount">
        </div>
    </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>手机：</label>
            <div class="formControls col-xs-4 col-sm-3">
                <input type="text" class="input-text" value="${users.telephone}" placeholder="" id="telephone" name="telephone">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">地址：</label>
            <div class="formControls col-xs-4 col-sm-3">
                <input type="text" class="input-text"  value="${users.address}" placeholder="" name="address" id="address">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>邮箱大小：</label>
            <div class="formControls col-xs-4 col-sm-3">
                <input type="text" class="input-text" value="${not empty users.max_mail_box_size?users.max_mail_box_size:domainModel.user_default_size}" placeholder="" id="max_mail_box_size" name="max_mail_box_size">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>网盘大小：</label>
            <div class="formControls col-xs-4 col-sm-3">
                <input type="text" class="input-text" value="${not empty users.max_message_size?users.max_message_size:domainModel.user_disk_default_size}" placeholder="" id="max_message_size" name="max_message_size">
            </div>
        </div>

        <%--<div class="row cl">--%>
            <%--<label class="form-label col-xs-4 col-sm-3">部门组：</label>--%>
            <%--<div class="formControls col-xs-8 col-sm-9"> <span class="select-box">--%>
                <%--<select class="select" size="1" name="group">--%>
                    <%--<option value="" selected>请选择组</option>--%>
                    <%--<option value="3">默认</option>--%>
                    <%--<option value="1">VIP</option>--%>
                    <%--<option value="2">test</option>--%>
                <%--</select>--%>
                <%--</span> </div>--%>
        <%--</div>--%>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">备注：</label>
            <div class="formControls col-xs-4 col-sm-3">
                <textarea name="remark" cols="" rows="" class="textarea"  placeholder="" onKeyUp="textarealength(this,100)">${users.remark}</textarea>
                <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
            <input type="hidden" name="user_type" value="0" />
        </div>

    <div class="row cl">
        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
            <span style="font-size: 10px;color:indianred">注:容量和数量如果设置位0则表示不进行限制</span>
        </div>
    </div>
</article>
</form>

<!--_footer 作为公共模版分离出去--> 
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.min.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.min.js"></script> 
<script type="text/javascript" src="static/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> 
<!--/_footer /作为公共模版分离出去--> 

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript">
$(function(){
    $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });
    $("#domain").on('change',function () {
        location.href='${pageContext.request.contextPath}/users-add.htmlx?domain='+$(this).val();
    });
    
    $("#form-member-add").validate({
        rules:{
        	user_name:{
                required:true,
                minlength:2,
                maxlength:16
            },
            name:{
                required:true,
            },
            <c:if test="${method eq 'add'}">
            password:{
                required:true,
            },
            password2:{
                required:true,
                equalTo: "#password"
            },
            </c:if>
            telephone:{
                required:true,
                isMobile:true,
            },
            max_mail_box_size:{
                required:true,
                digits:true
            },
            max_message_size:{
                required:true,
                digits:true
            },
            domain:{
                required:true,
            },
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
          //  var index = parent.layer.getFrameIndex(window.name);
            $.ajax({
                url: "userSave.htmlx",
                type:"POST",
                data:$(form).serializeArray(),
                dataType:'json',
                success: function(data){
                   //  parent.location.reload();
                    // parent.layer.close(index);
                    layer.msg('保存成功!',{icon: 1,time:1000});
                    $('input').val('');
                },
                error: function(data){
                     layer.msg('操作失败!请联系系统管理员!',{icon: 5,time:1000});
                }   
            })
        }
    });
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>